module.exports = {
    getInitialState: function(html) {
        const match = /window.INITIAL_STATE\s*=\s*(.*?);?\s*<\/script>/.exec(html);
        if (!match) return {};
        try {
            return JSON.parse(match[1]);
        } catch (e) {
            return {};
        }
    }
}